/*
 * @lc app=leetcode id=119 lang=cpp
 *
 * [119] Pascal's Triangle II
 */
class Solution {
public:
    vector<int> getRow(int rowIndex) {
        vector<int> res;

        for (int i=1; i<=rowIndex+1; i++) {
            res.push_back(1);
            for (int j=i-2; j>=1; j--) {
                res[j] = res[j-1] + res[j];
            }
        }
        return res;
        
    }
};

